<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>求职推荐 - 职场社交</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary: #2563eb;
            --primary-light: #eff6ff;
            --secondary: #0f766e;
            --dark: #1e293b;
            --gray: #64748b;
            --light-gray: #f1f5f9;
            --border-gray: #cbd5e1;
            --danger: #ef4444;
        }
        
        body {
            font-family: 'Inter', system-ui, sans-serif;
            background-color: #f8fafc;
            color: var(--dark);
            line-height: 1.6;
        }
        
        .navbar {
            background-color: white;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        }
        
        .logo {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--primary);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .main-container {
            padding: 2rem 0;
        }
        
        .page-title {
            font-size: 1.8rem;
            font-weight: 700;
            margin-bottom: 1.5rem;
            color: var(--dark);
        }
        
        .filter-bar {
            background-color: white;
            border-radius: 8px;
            padding: 1rem 1.5rem;
            margin-bottom: 2rem;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        }
        
        .filter-options {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            margin-bottom: 1rem;
        }
        
        .filter-tag {
            background-color: var(--light-gray);
            border-radius: 20px;
            padding: 0.35rem 1rem;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .filter-tag.active {
            background-color: var(--primary);
            color: white;
        }
        
        .filter-tag:hover:not(.active) {
            background-color: #e2e8f0;
        }
        
        .sort-options {
            display: flex;
            gap: 1rem;
            justify-content: flex-end;
        }
        
        .sort-option {
            color: var(--gray);
            cursor: pointer;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }
        
        .sort-option.active {
            color: var(--primary);
            font-weight: 500;
        }
        
        /* 卡片通用样式 */
        .job-card {
            background-color: white;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
            margin-bottom: 1.5rem;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        
        .job-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }
        
        .job-content {
            padding: 1.25rem;
        }
        
        .job-title {
            font-size: 1.25rem;
            font-weight: 600;
            margin-bottom: 0.75rem;
            color: var(--dark);
            text-decoration: none;
            display: block;
        }
        
        .job-title:hover {
            color: var(--primary);
        }
        
        .job-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            margin-bottom: 1rem;
            color: var(--gray);
            font-size: 0.9rem;
        }
        
        .job-meta-item {
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }
        
        .job-description {
            color: var(--dark);
            margin-bottom: 1rem;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .job-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }
        
        .job-tag {
            background-color: var(--primary-light);
            color: var(--primary);
            padding: 0.25rem 0.75rem;
            border-radius: 4px;
            font-size: 0.85rem;
        }
        
        .job-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-top: 1rem;
            border-top: 1px solid var(--light-gray);
        }
        
        .author-info {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }
        
        .author-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .author-name {
            font-weight: 500;
            font-size: 0.9rem;
        }
        
        .stats {
            display: flex;
            gap: 1.25rem;
            color: var(--gray);
            font-size: 0.9rem;
        }
        
        .stat-item {
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }
        
        .actions {
            display: flex;
            gap: 0.75rem;
        }
        
        .action-btn {
            color: var(--gray);
            background: none;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.25rem;
            font-size: 0.9rem;
            transition: color 0.2s;
        }
        
        .action-btn:hover {
            color: var(--primary);
        }
        
        .action-btn.liked {
            color: var(--danger);
        }
        
        .action-btn.saved {
            color: var(--primary);
        }
        
        /* 不同布局样式 */
        /* 无图片布局 */
        .job-card.no-image {
            border-left: 4px solid var(--primary);
        }
        
        /* 单图片布局 */
        .job-card.single-image .job-image-container {
            height: 180px;
            overflow: hidden;
        }
        
        .job-card.single-image .job-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s;
        }
        
        .job-card.single-image:hover .job-image {
            transform: scale(1.05);
        }
        
        /* 多图片布局 */
        .job-card.multi-image .job-image-container {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 4px;
            height: 180px;
            overflow: hidden;
        }
        
        .job-card.multi-image .job-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s;
        }
        
        .job-card.multi-image:hover .job-image {
            transform: scale(1.05);
        }
        
        /* 左侧图片布局 */
        .job-card.left-image {
            display: flex;
        }
        
        .job-card.left-image .job-image-container {
            width: 35%;
            min-width: 180px;
        }
        
        .job-card.left-image .job-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .job-card.left-image .job-content {
            width: 65%;
            display: flex;
            flex-direction: column;
        }
        
        .job-card.left-image .job-footer {
            margin-top: auto;
        }
        
        /* 网格布局容器 */
        .grid-layout {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
            gap: 1.5rem;
        }
        
 
        /* 布局切换按钮 */
        .layout-controls {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
        }
        
        .layout-btn {
            background-color: white;
            border: 1px solid var(--border-gray);
            border-radius: 6px;
            padding: 0.5rem 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .layout-btn.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        /* 响应式调整 */
        @media (max-width: 768px) {
            .job-card.left-image {
                flex-direction: column;
            }
            
            .job-card.left-image .job-image-container,
            .job-card.left-image .job-content {
                width: 100%;
            }
            
            .job-card.left-image .job-image-container {
                height: 160px;
            }
            
            .filter-options {
                margin-bottom: 0.75rem;
            }
            
            .sort-options {
                justify-content: flex-start;
                margin-top: 0.5rem;
            }
            
            .job-footer {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.75rem;
            }
            
            .stats {
                width: 100%;
                justify-content: space-between;
            }
            
            .actions {
                width: 100%;
                justify-content: space-between;
            }
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg py-3">
        <div class="container">
            <a href="#" class="logo">
                <i class="fas fa-briefcase"></i>
                职场社交
            </a>
            
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav ms-auto gap-4">
                    <li class="nav-item"><a href="#" class="nav-link">首页</a></li>
                    <li class="nav-item"><a href="#" class="nav-link active">求职</a></li>
                    <li class="nav-item"><a href="#" class="nav-link">招聘会</a></li>
                    <li class="nav-item"><a href="#" class="nav-link">公司</a></li>
                    <li class="nav-item"><a href="#" class="nav-link">社区</a></li>
                    <li class="nav-item">
                        <a href="#" class="nav-link" title="个人中心">
                            <img src="https://picsum.photos/100/100?random=1" alt="用户头像" class="rounded-circle" style="width: 32px; height: 32px;">
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>
    
    <div class="container main-container">
        <h1 class="page-title">求职推荐</h1>
        
        <!-- 布局切换 -->
        <div class="layout-controls">
            <button class="layout-btn active" id="listLayoutBtn" onclick="switchLayout('list')">
                <i class="fas fa-list"></i>
                列表布局
            </button>
            <button class="layout-btn" id="gridLayoutBtn" onclick="switchLayout('grid')">
                <i class="fas fa-th"></i>
                网格布局
            </button>
        </div>
        
        <!-- 筛选栏 -->
        <div class="filter-bar">
            <div class="filter-options">
                <div class="filter-tag active">全部</div>
                <div class="filter-tag">热门推荐</div>
                <div class="filter-tag">最新发布</div>
                <div class="filter-tag">高薪职位</div>
                <div class="filter-tag">应届生</div>
                <div class="filter-tag">远程工作</div>
                <div class="filter-tag">互联网</div>
                <div class="filter-tag">金融</div>
                <div class="filter-tag">教育</div>
            </div>
            
            <div class="sort-options">
                <div class="sort-option active" onclick="sortJobs('recommend')">
                    <i class="fas fa-star"></i>
                    推荐
                </div>
                <div class="sort-option" onclick="sortJobs('latest')">
                    <i class="fas fa-clock"></i>
                    最新
                </div>
                <div class="sort-option" onclick="sortJobs('hot')">
                    <i class="fas fa-fire"></i>
                    最热
                </div>
            </div>
        </div>
        
        <!-- 求职推荐内容区 -->
        <div class="job-recommendations" id="jobContainer">
            <!-- 无图片布局 -->
            <div class="job-card no-image">
                <div class="job-content">
                    <a href="#" class="job-title">后端开发工程师 - 未来科技有限公司</a>
                    
                    <div class="job-meta">
                        <div class="job-meta-item">
                            <i class="fas fa-map-marker-alt"></i>
                            北京 · 海淀区
                        </div>
                        <div class="job-meta-item">
                            <i class="fas fa-money-bill-wave"></i>
                            15k-25k · 13薪
                        </div>
                        <div class="job-meta-item">
                            <i class="fas fa-clock"></i>
                            发布于 3天前
                        </div>
                    </div>
                    
                    <div class="job-description">
                        负责公司核心业务系统的后端开发与维护，参与系统架构设计和技术选型，优化系统性能和安全性。要求3年以上Java开发经验，熟悉Spring Boot、微服务架构。
                    </div>
                    
                    <div class="job-tags">
                        <span class="job-tag">Java</span>
                        <span class="job-tag">后端开发</span>
                        <span class="job-tag">微服务</span>
                        <span class="job-tag">3-5年</span>
                    </div>
                    
                    <div class="job-footer">
                        <div class="author-info">
                            <img src="https://picsum.photos/100/100?random=10" alt="张明" class="author-avatar">
                            <span class="author-name">张明 · 技术总监</span>
                        </div>
                        
                        <div class="stats">
                            <div class="stat-item">
                                <i class="fas fa-eye"></i>
                                <span>1.2k</span>
                            </div>
                            <div class="stat-item">
                                <i class="fas fa-comment"></i>
                                <span>32</span>
                            </div>
                        </div>
                        
                        <div class="actions">
                            <button class="action-btn" onclick="toggleLike(this)">
                                <i class="far fa-heart"></i>
                                <span>点赞</span>
                            </button>
                            <button class="action-btn" onclick="toggleSave(this)">
                                <i class="far fa-bookmark"></i>
                                <span>收藏</span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 单图片布局 -->
            <div class="job-card single-image">
                <div class="job-image-container">
                    <img src="https://picsum.photos/800/400?random=20" alt="产品经理工作环境" class="job-image">
                </div>
                <div class="job-content">
                    <a href="#" class="job-title">资深产品经理 - 恒信金融服务集团</a>
                    
                    <div class="job-meta">
                        <div class="job-meta-item">
                            <i class="fas fa-map-marker-alt"></i>
                            上海 · 浦东新区
                        </div>
                        <div class="job-meta-item">
                            <i class="fas fa-money-bill-wave"></i>
                            25k-35k · 14薪
                        </div>
                        <div class="job-meta-item">
                            <i class="fas fa-clock"></i>
                            发布于 1周前
                        </div>
                    </div>
                    
                    <div class="job-description">
                        负责金融科技产品的全生命周期管理，包括需求分析、产品设计、项目推进和市场反馈。要求5年以上金融科技产品经验，有成功的产品落地案例。
                    </div>
                    
                    <div class="job-tags">
                        <span class="job-tag">产品经理</span>
                        <span class="job-tag">金融科技</span>
                        <span class="job-tag">需求分析</span>
                        <span class="job-tag">5年以上</span>
                    </div>
                    
                    <div class="job-footer">
                        <div class="author-info">
                            <img src="https://picsum.photos/100/100?random=11" alt="李娜" class="author-avatar">
                            <span class="author-name">李娜 · 产品负责人</span>
                        </div>
                        
                        <div class="stats">
                            <div class="stat-item">
                                <i class="fas fa-eye"></i>
                                <span>2.5k</span>
                            </div>
                            <div class="stat-item">
                                <i class="fas fa-comment"></i>
                                <span>56</span>
                            </div>
                        </div>
                        
                        <div class="actions">
                            <button class="action-btn liked" onclick="toggleLike(this)">
                                <i class="fas fa-heart"></i>
                                <span>已赞</span>
                            </button>
                            <button class="action-btn" onclick="toggleSave(this)">
                                <i class="far fa-bookmark"></i>
                                <span>收藏</span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 多图片布局 -->
            <div class="job-card multi-image">
                <div class="job-image-container">
                    <img src="https://picsum.photos/400/300?random=30" alt="教室环境" class="job-image">
                    <img src="https://picsum.photos/400/300?random=31" alt="教学活动" class="job-image">
                    <img src="https://picsum.photos/400/300?random=32" alt="团队照片" class="job-image">
                </div>
                <div class="job-content">
                    <a href="#" class="job-title">中小学数学教师 - 智慧教育科技有限公司</a>
                    
                    <div class="job-meta">
                        <div class="job-meta-item">
                            <i class="fas fa-map-marker-alt"></i>
                            广州 · 天河区
                        </div>
                        <div class="job-meta-item">
                            <i class="fas fa-money-bill-wave"></i>
                            10k-18k · 年终奖
                        </div>
                        <div class="job-meta-item">
                            <i class="fas fa-clock"></i>
                            发布于 2天前
                        </div>
                    </div>
                    
                    <div class="job-description">
                        负责中小学数学课程的教学工作，制定教学计划，编写教案，组织课堂活动，跟踪学生学习进度并提供个性化指导。要求师范类相关专业毕业，有教学经验者优先。
                    </div>
                    
                    <div class="job-tags">
                        <span class="job-tag">教师</span>
                        <span class="job-tag">数学</span>
                        <span class="job-tag">教育</span>
                        <span class="job-tag">应届生</span>
                    </div>
                    
                    <div class="job-footer">
                        <div class="author-info">
                            <img src="https://picsum.photos/100/100?random=12" alt="王丽" class="author-avatar">
                            <span class="author-name">王丽 · 人力资源总监</span>
                        </div>
                        
                        <div class="stats">
                            <div class="stat-item">
                                <i class="fas fa-eye"></i>
                                <span>856</span>
                            </div>
                            <div class="stat-item">
                                <i class="fas fa-comment"></i>
                                <span>23</span>
                            </div>
                        </div>
                        
                        <div class="actions">
                            <button class="action-btn" onclick="toggleLike(this)">
                                <i class="far fa-heart"></i>
                                <span>点赞</span>
                            </button>
                            <button class="action-btn saved" onclick="toggleSave(this)">
                                <i class="fas fa-bookmark"></i>
                                <span>已收藏</span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 左侧图片布局 -->
            <div class="job-card left-image">
                <div class="job-image-container">
                    <img src="https://picsum.photos/400/600?random=40" alt="UI设计师作品集" class="job-image">
                </div>
                <div class="job-content">
                    <a href="#" class="job-title">UI/UX设计师 - 创新科技有限公司</a>
                    
                    <div class="job-meta">
                        <div class="job-meta-item">
                            <i class="fas fa-map-marker-alt"></i>
                            深圳 · 南山区
                        </div>
                        <div class="job-meta-item">
                            <i class="fas fa-money-bill-wave"></i>
                            18k-28k · 项目奖金
                        </div>
                        <div class="job-meta-item">
                            <i class="fas fa-clock"></i>
                            发布于 5天前
                        </div>
                    </div>
                    
                    <div class="job-description">
                        负责公司产品的用户界面设计和用户体验优化，参与产品设计流程，制作高保真原型和设计规范，与开发团队紧密合作确保设计落地。要求熟练掌握Figma、Sketch等设计工具，有良好的审美能力。
                    </div>
                    
                    <div class="job-tags">
                        <span class="job-tag">UI设计</span>
                        <span class="job-tag">UX设计</span>
                        <span class="job-tag">产品设计</span>
                        <span class="job-tag">2-4年</span>
                    </div>
                    
                    <div class="job-footer">
                        <div class="author-info">
                            <img src="https://picsum.photos/100/100?random=13" alt="刘洋" class="author-avatar">
                            <span class="author-name">刘洋 · 设计总监</span>
                        </div>
                        
                        <div class="stats">
                            <div class="stat-item">
                                <i class="fas fa-eye"></i>
                                <span>1.7k</span>
                            </div>
                            <div class="stat-item">
                                <i class="fas fa-comment"></i>
                                <span>41</span>
                            </div>
                        </div>
                        
                        <div class="actions">
                            <button class="action-btn" onclick="toggleLike(this)">
                                <i class="far fa-heart"></i>
                                <span>点赞</span>
                            </button>
                            <button class="action-btn" onclick="toggleSave(this)">
                                <i class="far fa-bookmark"></i>
                                <span>收藏</span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 无图片布局 -->
            <div class="job-card no-image">
                <div class="job-content">
                    <a href="#" class="job-title">市场营销专员 - 优享服务集团</a>
                    
                    <div class="job-meta">
                        <div class="job-meta-item">
                            <i class="fas fa-map-marker-alt"></i>
                            杭州 · 西湖区
                        </div>
                        <div class="job-meta-item">
                            <i class="fas fa-money-bill-wave"></i>
                            12k-20k · 绩效奖金
                        </div>
                        <div class="job-meta-item">
                            <i class="fas fa-clock"></i>
                            发布于 1天前
                        </div>
                    </div>
                    
                    <div class="job-description">
                        负责公司服务产品的市场推广和品牌建设，制定营销策略，组织线上线下活动，分析市场数据并优化推广效果。要求具备良好的沟通能力和市场洞察力，有相关行业经验者优先。
                    </div>
                    
                    <div class="job-tags">
                        <span class="job-tag">市场营销</span>
                        <span class="job-tag">品牌推广</span>
                        <span class="job-tag">活动策划</span>
                        <span class="job-tag">1-3年</span>
                    </div>
                    
                    <div class="job-footer">
                        <div class="author-info">
                            <img src="https://picsum.photos/100/100?random=14" alt="赵静" class="author-avatar">
                            <span class="author-name">赵静 · 市场经理</span>
                        </div>
                        
                        <div class="stats">
                            <div class="stat-item">
                                <i class="fas fa-eye"></i>
                                <span>923</span>
                            </div>
                            <div class="stat-item">
                                <i class="fas fa-comment"></i>
                                <span>18</span>
                            </div>
                        </div>
                        
                        <div class="actions">
                            <button class="action-btn liked" onclick="toggleLike(this)">
                                <i class="fas fa-heart"></i>
                                <span>已赞</span>
                            </button>
                            <button class="action-btn saved" onclick="toggleSave(this)">
                                <i class="fas fa-bookmark"></i>
                                <span>已收藏</span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 单图片布局 -->
            <div class="job-card single-image">
                <div class="job-image-container">
                    <img src="https://picsum.photos/800/400?random=50" alt="数据分析师工作场景" class="job-image">
                </div>
                <div class="job-content">
                    <a href="#" class="job-title">数据分析师 - 数字智能科技公司</a>
                    
                    <div class="job-meta">
                        <div class="job-meta-item">
                            <i class="fas fa-map-marker-alt"></i>
                            成都 · 高新区
                        </div>
                        <div class="job-meta-item">
                            <i class="fas fa-money-bill-wave"></i>
                            16k-26k · 年终分红
                        </div>
                        <div class="job-meta-item">
                            <i class="fas fa-clock"></i>
                            发布于 4天前
                        </div>
                    </div>
                    
                    <div class="job-description">
                        负责公司业务数据的收集、清洗、分析和可视化，构建数据分析模型，为业务决策提供数据支持。要求熟练使用Python、SQL、Tableau等工具，有大数据分析经验者优先。
                    </div>
                    
                    <div class="job-tags">
                        <span class="job-tag">数据分析</span>
                        <span class="job-tag">Python</span>
                        <span class="job-tag">SQL</span>
                        <span class="job-tag">3-5年</span>
                    </div>
                    
                    <div class="job-footer">
                        <div class="author-info">
                            <img src="https://picsum.photos/100/100?random=15" alt="陈明" class="author-avatar">
                            <span class="author-name">陈明 · 数据总监</span>
                        </div>
                        
                        <div class="stats">
                            <div class="stat-item">
                                <i class="fas fa-eye"></i>
                                <span>1.5k</span>
                            </div>
                            <div class="stat-item">
                                <i class="fas fa-comment"></i>
                                <span>29</span>
                            </div>
                        </div>
                        
                        <div class="actions">
                            <button class="action-btn" onclick="toggleLike(this)">
                                <i class="far fa-heart"></i>
                                <span>点赞</span>
                            </button>
                            <button class="action-btn" onclick="toggleSave(this)">
                                <i class="far fa-bookmark"></i>
                                <span>收藏</span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 加载更多 -->
        <div class="text-center mt-4 mb-5">
            <button class="btn btn-outline-primary" onclick="loadMoreJobs()">
                加载更多求职推荐
                <i class="fas fa-chevron-down ms-1"></i>
            </button>
        </div>
    </div>
    
    
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>

        
        // 切换点赞状态
        function toggleLike(button) {
            const icon = button.querySelector('i');
            const text = button.querySelector('span');
            
            if (icon.classList.contains('far')) {
                // 未点赞 -> 点赞
                icon.classList.remove('far');
                icon.classList.add('fas');
                button.classList.add('liked');
                text.textContent = '已赞';
                showToast('点赞成功');
            } else {
                // 已点赞 -> 取消点赞
                icon.classList.remove('fas');
                icon.classList.add('far');
                button.classList.remove('liked');
                text.textContent = '点赞';
                showToast('已取消点赞');
            }
        }
        
        // 切换收藏状态
        function toggleSave(button) {
            const icon = button.querySelector('i');
            const text = button.querySelector('span');
            
            if (icon.classList.contains('far')) {
                // 未收藏 -> 收藏
                icon.classList.remove('far');
                icon.classList.add('fas');
                button.classList.add('saved');
                text.textContent = '已收藏';
                showToast('收藏成功');
            } else {
                // 已收藏 -> 取消收藏
                icon.classList.remove('fas');
                icon.classList.add('far');
                button.classList.remove('saved');
                text.textContent = '收藏';
                showToast('已取消收藏');
            }
        }
        
        // 切换布局
        function switchLayout(layoutType) {
            const jobContainer = document.getElementById('jobContainer');
            const listBtn = document.getElementById('listLayoutBtn');
            const gridBtn = document.getElementById('gridLayoutBtn');
            
            if (layoutType === 'list') {
                jobContainer.classList.remove('grid-layout');
                listBtn.classList.add('active');
                gridBtn.classList.remove('active');
                showToast('已切换到列表布局');
            } else {
                jobContainer.classList.add('grid-layout');
                gridBtn.classList.add('active');
                listBtn.classList.remove('active');
                showToast('已切换到网格布局');
            }
        }
        
        // 排序功能
        function sortJobs(sortType) {
            document.querySelectorAll('.sort-option').forEach(option => {
                option.classList.remove('active');
            });
            document.querySelector(`.sort-option[onclick="sortJobs('${sortType}')"]`).classList.add('active');
            
            let message = '';
            switch(sortType) {
                case 'recommend':
                    message = '已按推荐排序';
                    break;
                case 'latest':
                    message = '已按最新排序';
                    break;
                case 'hot':
                    message = '已按最热排序';
                    break;
            }
            showToast(message);
        }
        
        // 筛选标签点击
        document.querySelectorAll('.filter-tag').forEach(tag => {
            tag.addEventListener('click', function() {
                document.querySelectorAll('.filter-tag').forEach(t => {
                    t.classList.remove('active');
                });
                this.classList.add('active');
                showToast(`已筛选: ${this.textContent}`);
            });
        });
        
        // 加载更多
        function loadMoreJobs() {
            showToast('正在加载更多求职推荐...');
            // 模拟加载延迟
            setTimeout(() => {
                showToast('已加载全部求职推荐');
            }, 1500);
        }
    </script>
</body>
</html>
    
